package cn.javabb.web.shiro;

import cn.javabb.common.utils.RequestUtil;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.AccessControlFilter;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

/**
 * @desc:   实现访问板块的时候的
 * @author: javabb (javabob(a)163.com)
 * @create: 2019/09/01 01:01
 */
public class CatalogPermissionFilter extends AccessControlFilter {
    @Override
    protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception {
        Subject subject = getSubject(request,response);

        System.out.println(mappedValue);
        return false;
    }

    @Override
    protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
        Subject subject = getSubject(request,response);
        System.out.println("requestUrl:"+ RequestUtil.getRequestUrl());
        return false;
    }
}
